// ==UserScript==
// @name         lagou教育全屏
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       liezh
// @match        https://kaiwu.lagou.com/course/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // Your code here...

})();

window.onload = function () {
    var button = document.createElement("input");
    button.setAttribute("value", "全屏");
    button.setAttribute("type", "button");
    button.style = "position: absolute;" +
        "right: 20px;" +
        "bottom: 20px;" +
        "z-index: 99999;" +
        "background: white;" +
        "color: black;" +
        "padding: 5px;" +
        "border-radius: 5px;";
    button.setAttribute("onclick", "fullScreen();");
    var body = document.body;
    body.appendChild(button);

    let fullScreen = document.createElement("script");
    let jss = "";
    jss += "function fullScreen() {";
    jss += "var pcheader = document.getElementsByClassName('wrap pc-header');"
    jss += "pcheader[0].style.display = 'none';"
    jss += "var pubheader = document.getElementsByClassName('pub-header');"
    jss += "pubheader[0].style.top = '0px';"
    jss += "var leftwrap = document.getElementsByClassName('left-content-wrap');"
    jss += "leftwrap[0].style.marginTop = '0px';";
    jss += "var rightwrap = document.getElementsByClassName('right-content-wrap');";
    jss += "rightwrap[0].style.marginTop = '0px';";
    jss += "}";
    fullScreen.text = jss;
    body.appendChild(fullScreen);
}
